﻿@model TodoListApp.Models.ViewModels.TodoViewModel


<div class="row justify-content-center">
    <div class="col-xl-6 col-lg-8 col-md-8 col-sm-10">
        
        <table class="table">
            <thead>
            <tr class="table-primary">
                <th scope="col">Id</th>
                <th scope="col">Name</th>
                <th scope="col"></th>
            </tr>
            </thead>
            <tbody>
            @foreach (var t in Model.TodoList)
            {
                <tr>
                    <th class="todos-column" scope="row">@t.Id</th>
                    <th class="todos-column">@t.Name</th>
                    <td class="buttons-column">
                        <input type="submit" class="btn btn-danger" value="Delete" onclick="deleteTodo(@t.Id)"/>
                        <input type="submit" class="btn btn-primary" value="Update" onclick="populateForm(@t.Id)"/>
                    </td>
                </tr>
            }
            </tbody>
        </table>
    </div>
</div>
